//
//  main.m
//  Runtime
//
//  Created by wangrui on 14-7-2.
//  Copyright (c) 2014年 PPS. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <objc/runtime.h>


@interface A : NSString

@end

@implementation A



@end




int main(int argc, const char * argv[]) {
	@autoreleasepool {
		
		
		A *aa = [A new];
		
		Class ac = object_getClass(aa);
		Class metal = object_getClass(ac); //because ordinary class can treat as object
		
		BOOL isMental = class_isMetaClass(metal);
		NSLog(@"Is metal:%d",isMental);

		Class metalClassFromName = objc_getMetaClass("A");
		
		if (metal == metalClassFromName) {
			NSLog(@"class's 'isa' pointer point to a class which is metal class");
		}
		
		Class metalClassIsaPoniterClass = object_getClass(metal);
		
		if (metalClassIsaPoniterClass == object_getClass([NSObject class])) {
			NSLog(@"Metal class's 'isa' pointer point to Metal NSObject class");
		}
		
	}
    return 0;
}
